#ifndef __VD_INDEX_H__
#define __VD_INDEX_H__
#include <string>
#include <vector>
#include <memory>

enum MetricType {
    MetricType_L2 = 0,
    MetricType_IP = 1,
    MetricType_COS = 2,
};


class Index {
public:
    virtual void add(std::shared_ptr<std::vector<float>> vector) = 0;
    virtual void add_with_ids(std::shared_ptr<std::vector<float>> vector, std::shared_ptr<std::vector<uint64_t>> ids) = 0;
    /** 
     * @brief 搜索
     * @param vector 查询向量
     * @param k 返回结果数量
     * @param results 返回结果
    */
    virtual void search(std::shared_ptr<std::vector<float>> vector, int k, std::shared_ptr<std::vector<std::pair<uint64_t /* id */, float/* 距离 */>>> results) = 0;
public:
    Index(uint16_t dim, MetricType metric_type);
    ~Index();

private:
    uint16_t _dim; // 维度
    MetricType _metric_type; // 距离度量类型
    uint64_t _total_count; // 总数量

};
#endif